home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2002 #11
/
Amiga Plus CD - 2002 - No. 11.iso
/
Tools
/
Development
/
Feelin021015
/
Examples
/
Demo.e
< prev
next >
Wrap
Text File
|
2002-10-28
|
13KB
|
401 lines
OPT PREPROCESS
MODULE 'feelin','libraries/feelin','a4',
'graphics/gfxmacros','graphics/rastport'
PROC main()
DEF c,w,
p1,g1,myback[16]:STRING
-> grp1,grp2,grp3,b1,b2,b3, p1,p2,p3,p4, g1,g2,g3, s1, i=NIL,inc=TRUE
sys_SGlob()
StringF(myback,'F:\h\0',{drawfunc})
IF feelinbase := OpenLibrary('feelin.library',0)
c := ClientObject, FA_Client_Base,'DEMO',
Child, w := WindowObject, FA_Window_Title,'Feelin : Demo',
Child, VGroup,
Child, Page, FA_Group_PageTitles,['About','Objects','Groups','Special','a','b','c','d',NIL],
->PROC About
Child, CrawlerObject, GaugeFrame, FA_Crawler_Delay,40, FA_Crawler_Micros,60000, FA_ChainToCycle,FALSE, ->FA_MinHeight,8*3,
Child, TextObject,
FA_Font,'Mario/13',
FA_Back, myback,
FA_Inner,[20,5,20,5]:CHAR,
FA_ChainToCycle,FALSE,
FA_Text, {__CrawText},
FA_TextDisplay_Interline,2,
End,
End,
->ENDPROC
->PROC Objects
Child, Page, FA_Group_PageTitles,['Simple Buttons','Gauges','Proportionals','Sliders','Strings',NIL],
->PROC Objects / Buttons
Child, HGroup, GroupFrame, FA_Frame_Title,'Buttons with differents Inputs',
Child, button('_Immediate',FV_InputMode_Immediate),
Child, button('_Toggle',FV_InputMode_Toggle),
Child, button('_Release',FV_InputMode_Release),
End,
->ENDPROC
->PROC Objects / Gauges
Child, HGroup,
Child, VGroup,
Child, Gauge(TRUE,0,100, 25),
Child, Gauge(TRUE,0,100, 50),
Child, Gauge(TRUE,0,100, 75),
Child, Gauge(TRUE,0,100,100),
Child, Gauge(TRUE,0,100, 0),
End,
Child, Bar,
Child, VGroup, FA_FixedHeight,TRUE,
Child, Gauge(TRUE,0,100, 0),
Child, Gauge(TRUE,0,100,100),
Child, Gauge(TRUE,0,100, 0),
Child, Gauge(TRUE,0,100,100),
End,
Child, Bar,
Child, HGroup, FA_Weight, 25,
Child, Gauge(FALSE,0,100, 25),
Child, Gauge(FALSE,0,100, 50),
Child, Gauge(FALSE,0,100, 75),
Child, Gauge(FALSE,0,100, 100),
End,
End,
->ENDPROC
->PROC Objects / Props
Child, HGroup,
Child, VGroup,
Child, Prop(TRUE,32,16,0),
Child, Prop(TRUE,32,08,0),
Child, Prop(TRUE,32,04,0),
Child, Prop(TRUE,32,02,0),
End,
Child, VGroup, FA_FixedHeight,TRUE,
Child, Prop(TRUE,32,16,0),
Child, Prop(TRUE,32,08,0),
Child, Prop(TRUE,32,04,0),
Child, Prop(TRUE,32,02,0),
End,
Child, HGroup,
Child, Prop(FALSE,32,16,0),
Child, Prop(FALSE,32,08,0),
Child, Prop(FALSE,32,04,0),
Child, Prop(FALSE,32,02,0),
End,
End,
->ENDPROC
->PROC Objects / Sliders
Child, HGroup,
Child, VGroup, FA_FixedHeight,TRUE,
Child, SliderObject, FA_Horizontal,TRUE, SliderFrame,FA_Back,FI_Shine, FA_Numeric_Max,10, FA_Numeric_Value, 0, End,
Child, SliderObject, FA_Horizontal,TRUE, SliderFrame,FA_Back,FI_Fill, FA_Numeric_Max,10, FA_Numeric_Value, 5, End,
Child, SliderObject, FA_Horizontal,TRUE, SliderFrame,FA_Back,FI_Shadow, FA_Numeric_Max,10, FA_Numeric_Value,10, End,
Child, Bar,
Child, SliderObject, FA_Horizontal,TRUE, SliderFrame,FA_Back,FI_Dark, FA_Numeric_Max, 3, FA_Numeric_Min, 1, FA_Numeric_Value, 1, End,
Child, SliderObject, FA_Horizontal,TRUE, SliderFrame,FA_Back,FI_Highlight, FA_Numeric_Max, 3, FA_Numeric_Min, -3, FA_Numeric_Value, 0, End,
End,
Child, Bar,
Child, HGroup, FA_Weight,50,
Child, SliderObject, FA_ChainToCycle,FALSE, SliderFrame,FA_Back,FI_Dark, FA_Numeric_Max, 32, End,
Child, SliderObject, SliderFrame,FA_Back,FI_Shine, FA_Numeric_Max, 3, FA_Numeric_Min, -3, FA_Numeric_Value, 0, End,
End,
End,
->ENDPROC
End,
->ENDPROC
->PROC Groups
Child, Page, FA_Group_PageTitles,['Types','Layout',NIL],
Child, HGroup, FA_Group_SameSize,TRUE,
Child, HGroup, GroupFrame, FA_Frame_Title, 'Horizontal',
Child, rectObj(),
Child, rectObj(),
Child, rectObj(),
End,
Child, VGroup, GroupFrame, FA_Frame_Title, 'Vertical',
Child, rectObj(),
Child, rectObj(),
Child, rectObj(),
End,
Child, VGroup, GroupFrame, FA_Frame_Title, 'Array',
Child, HGroup, Child, rectObj(), Child, rectObj(), Child, rectObj(), End,
Child, HGroup, Child, rectObj(), Child, rectObj(), Child, rectObj(), End,
Child, HGroup, Child, rectObj(), Child, rectObj(), Child, rectObj(), End,
End,
End,
Child, VGroup,
Child, HGroup, GroupFrame, FA_Frame_Title, 'Different Weights',
Child, textObj( '25 kg',[FA_Weight, 25, NIL]),
Child, textObj( '50 kg',[FA_Weight, 50, NIL]),
Child, textObj( '75 kg',[FA_Weight, 75, NIL]),
Child, textObj('100 kg',[FA_Weight,100, NIL]),
End,
Child, HGroup, GroupFrame, FA_Frame_Title, 'Fixed & Variable Sizes',
Child, textObj('fixed',[FA_FixedWidth,TRUE, NIL]),
Child, textObj('free'),
Child, textObj('fixed',[FA_FixedWidth,TRUE, NIL]),
Child, textObj('free'),
Child, textObj('fixed',[FA_FixedWidth,TRUE, NIL]),
End,
Child, HGroup, GroupFrame, FA_Frame_Title, 'Relative Sizes', FA_Group_RelSizing,TRUE,
Child, textObj('1'),
Child, textObj('12'),
Child, textObj('123'),
Child, textObj('1234'),
Child, textObj('12345'),
End,
Child, HGroup, GroupFrame, FA_Frame_Title, 'Same Width', FA_Group_SameWidth,TRUE,
Child, textObj('1'),
Child, textObj('12'),
Child, textObj('123'),
Child, textObj('1234'),
End,
End,
End,
->ENDPROC
->PROC Special
Child, Page, FA_Group_PageTitles,['Rasters','Text Engine'],
->PROC Special / Rasters
Child, VGroup, FA_Group_VSpacing, 0,
Child, HGroup, FA_Group_HSpacing, 0,
Child, rast(FI_Highlight),
Child, rast(FI_Shine_Highlight),
Child, rast(FI_HalfShine_Highlight),
Child, rast(FI_Fill_Highlight),
Child, rast(FI_HalfShadow_Highlight),
Child, rast(FI_Shadow_Highlight),
Child, rast(FI_HalfDark_Highlight),
Child, rast(FI_Dark_Highlight),
End,
Child, HGroup, FA_Group_HSpacing, 0,
Child, rast(FI_Shine),
Child, rast(FI_Shine_HalfShine),
Child, rast(FI_Shine_Fill),
Child, rast(FI_Shine_HalfShadow),
Child, rast(FI_Shine_Shadow),
Child, rast(FI_Shine_HalfDark),
Child, rast(FI_Shine_Dark),
End,
Child, HGroup, FA_Group_HSpacing, 0,
Child, rast(FI_HalfShine),
Child, rast(FI_HalfShine_Fill),
Child, rast(FI_HalfShine_HalfShadow),
Child, rast(FI_HalfShine_Shadow),
Child, rast(FI_HalfShine_HalfDark),
Child, rast(FI_HalfShine_Dark),
End,
Child, HGroup, FA_Group_HSpacing, 0,
Child, rast(FI_Fill),
Child, rast(FI_Fill_HalfShadow),
Child, rast(FI_Fill_Shadow),
Child, rast(FI_Fill_HalfDark),
Child, rast(FI_Fill_Dark),
End,
Child, HGroup, FA_Group_HSpacing, 0,
Child, rast(FI_HalfShadow),
Child, rast(FI_HalfShadow_Shadow),
Child, rast(FI_HalfShadow_HalfDark),
Child, rast(FI_HalfShadow_Dark),
End,
Child, HGroup, FA_Group_HSpacing, 0,
Child, rast(FI_Shadow),
Child, rast(FI_Shadow_HalfDark),
Child, rast(FI_Shadow_Dark),
End,
Child, HGroup, FA_Group_HSpacing, 0,
Child, rast(FI_HalfDark),
Child, rast(FI_HalfDark_Dark),
End,
Child, rast(FI_Dark),
End,
->ENDPROC
->PROC Special / Text Engine
Child, TextObject,
FA_ChainToCycle, FALSE,
FA_FixedHeight, TRUE,
FA_Text, {__Text},
FA_Text_SetMin, FALSE,
FA_TextDisplay_Interline, 5,
End,
->ENDPROC
End,
->ENDPROC
End,
End,
End,
End
IF c
/*
F_DoA(b1,FM_Notify,[FA_Pressed,FALSE,p,3,FM_Set,FA_Page_Active,grp1])
F_DoA(b2,FM_Notify,[FA_Pressed,FALSE,p,3,FM_Set,FA_Page_Active,grp2])
F_DoA(b3,FM_Notify,[FA_Pressed,FALSE,p,3,FM_Set,FA_Page_Active,grp3])
F_DoA(p4,FM_Notify,[FA_Prop_First,FV_Notify_Always,p3,3,FM_Set,FA_Prop_First,FV_Notify_Value])
F_DoA(p3,FM_Notify,[FA_Prop_First,FV_Notify_Always,p2,3,FM_Set,FA_Prop_First,FV_Notify_Value])
F_DoA(p2,FM_Notify,[FA_Prop_First,FV_Notify_Always,p1,3,FM_Set,FA_Prop_First,FV_Notify_Value])
F_DoA(g1,FM_Notify,[FA_Numeric_Value,FV_Notify_Always,g3,5,FM_Set,FA_Numeric_Value,FV_Notify_Value,FA_Numeric_Multiply,2])
F_DoA(g1,FM_Notify,[FA_Numeric_Value,FV_Notify_Always,s1,5,FM_Set,FA_Numeric_Value,FV_Notify_Value,FA_Numeric_Multiply,2])
*/
F_DoA(w,FM_Notify,[FA_Window_CloseRequest,TRUE,FV_Notify_Client,2,FM_Client_ReturnID,FV_Client_Quit])
F_Set(w,FA_Window_Open,TRUE)
F_DoA(c,FM_Client_Run,NIL)
/*
WHILE F_DoA(c,FM_Client_Event,NIL) <> FV_Client_Quit
IF (i := i + 1) = 80
IF inc
F_DoA(g1,FM_Numeric_Increase,[1])
IF F_Get(g1,FA_Numeric_Value) = 16 THEN inc := FALSE
ELSE
F_DoA(g1,FM_Numeric_Decrease,[1])
IF F_Get(g1,FA_Numeric_Value) = 0 THEN inc := TRUE
ENDIF ; i := NIL
ENDIF
F_Set(g2,FA_Numeric_Value,Rnd(100))
ENDWHILE
*/
F_DisposeObj(c)
ENDIF
CloseLibrary(feelinbase)
ELSE
WriteF('Unable to open feelin.library\n')
ENDIF
ENDPROC
PROC textObj(name,tags=NIL)
RETURN TextObject,
FA_ChainToCycle, FALSE,
FA_FixedHeight, TRUE,
FA_Frame, FP_Frame_Text,
FA_Back, FI_HalfShadow,
FA_Text, name,
FA_Text_PreParse, '`c',
2, tags,
End
ENDPROC
PROC rectObj()
RETURN AreaObject,
FA_ChainToCycle, FALSE,
FA_Frame, FP_Frame_Text,
FA_Back, FI_HalfShadow,
End
ENDPROC
PROC rast(rast)
RETURN AreaObject,
FA_ChainToCycle, FALSE,
FA_Back, rast,
End
ENDPROC
PROC button(label,input)
RETURN TextObject,
FA_FixedHeight, TRUE,
FA_Frame, FP_Frame_Button,
FA_Font, FP_Font_Button,
FA_Back, FP_Back_Button,
FA_AltBack, FP_Back_ButtonAlt,
FA_InputMode, input,
FA_Text, label,
FA_Text_PreParse, '`c',
FA_Text_SetMin, TRUE,
End
ENDPROC
PROC drawfunc(render=A0:PTR TO feelinRender,region=A2:PTR TO feelinRect)
DEF x1,y1,x2,y2,x3,rp
sys_RGlob()
x1 := region.x1 ; x3 := region.x2 ; x2 := x3 - x1 / 3 + x1
y1 := region.y1 ; y2 := region.y2 ; rp := render.rport
_APen(render.pens[FV_Pen_HalfShadow]) ; _Boxf(x1,y1,x2,y2)
_APen(render.pens[FV_Pen_Fill]) ; _Boxf(x2+1,y1,x3,y2)
ENDPROC
->PROC Objects / Strings
/*
Child, VGroup, NoFrame, FA_FixedHeight,TRUE,
Child, BarTitle('Numeric string'),
Child, F_MakeObjA(FO_String,['1234',32],[FA_String_Accept,{__Num}, NIL]),
Child, BarTitle('Hexadecimal string'),
Child, F_MakeObjA(FO_String,['FF123a',32],[FA_String_Accept,{__Hex}, NIL]),
Child, BarTitle('Alphabetic strings & Alignement'),
Child, HGroup, NoFrame,
Child, F_MakeObjA(FO_String,['Lotan is my Lord',80],[FA_String_Reject,{__Num}, FA_String_Format,FV_String_Format_Left, NIL]),
Child, F_MakeObjA(FO_String,['Lotan is my Lord',80],[FA_String_Reject,{__Num}, FA_String_Format,FV_String_Format_Center, NIL]),
Child, F_MakeObjA(FO_String,['Lotan is my Lord',80],[FA_String_Reject,{__Num}, FA_String_Format,FV_String_Format_Right, NIL]),
End,
End,
*/
->ENDPROC
->PROC Datas
__Text:
CHAR '`c`<0>',
'Normal text\n',
'`<8>Highlighted text`<0>\n',
-> '`A1C`A2o`A3l`A4o`A5r`A6e`A7d `A6t`A5e`A4x`A3t`A0\n',
-> '`M1`B7`A1C`B6`A2o`B5`A3l`B4`A4o`B3`A5r`B2`A6e`B1`A7d `B2`A6t`B3`A5e`B4`A4x`B5`A3t`B6`A0`M0\n',
'`SeEmboss`Sn & `SgGhost`Sn\n',
'`ShSome Light`Sn & `SsSome Shadow`Sn\n',
'`Sh`SsLight & Shadow`Sn Or `Se`SsEmboss & Shadow`Sn\n',
'`iItalic`n, `bBold`n, `uUnderlined`n, Normal, `i`b`uMixed`n\n',
'`lA very, very, very long line that will be nicely truncated\n',
'`cA very, very, very long line that will be nicely truncated\n',
'`rA very, very, very long line that will be nicely truncated',NIL
__CrawText:
CHAR '\n`c`Ss`<1>!! Welcome !!`<0>`Sn\n\n',
'Yes, welcome to a brand new world !\n\t\n',
'Well... This is `Ss`ShFeelin`Sn, a new\n',
'`bObject Oriented System`n.\n\n',
'`Ss`ShFeelin`Sn is new, written from scratch.\n',
'It does not use `bBOOPSI`n\n',
'or `uany`n other kind of stuff.\n\n',
'`Ss`ShFeelin`Sn is very fast,\n',
'easy to use, and very small :\n',
'feelin.library is about 5Ko\n\n',
'It is complety flexible and expandable.\n\t\n',
'`c`Ss`ShFeelin`Sn has no past,\n',
'only future.\n\n\n',
'`c`iWell, I hope ;-)`n...\n\n\n',
'`SsE`<5>n`<2>j`<5>o`<0>y,\n\n\n',
'`<1>L`<2>o`<4>t`<5>s `<6>o`<7>f `<6>l`<5>o`<4>v`<2>e`<0> `<1>!`<4>!`<1>!`<0>`Sn\n\n\n\n',NIL
__Hex: CHAR 'ABCDEFabcdef'
__Num: CHAR '1234567890',0
->ENDPROC